{% extends "base.html" %}
{% block content %}
<div class="container-fluid py-4">
    <h2 class="mb-4 border-bottom pb-2 text-primary">下家投注记录</h2>

    <div class="table-responsive rounded-3 shadow-sm">
        <table class="table table-hover table-striped mb-0">
            <thead class="table-dark">
                <tr>
                    <th scope="col" class="py-3">用户</th>
                    <th scope="col" class="py-3">期号</th>
                    <th scope="col" class="py-3">类型</th>
                    <th scope="col" class="py-3 text-end">金额</th>
                    <th scope="col" class="py-3">时间</th>
                </tr>
            </thead>
            <tbody class="border-top-0">
                {% for bet in bet_records %}
                <tr>
                    <td class="align-middle">{{ bet.user.username }}</td>
                    <td class="align-middle">{{ bet.issue }}</td>
                    <td class="align-middle">
                        <span class="badge bg-primary">
                            {{ bet.get_bet_type_display }}
                        </span>
                    </td>
                    <td class="align-middle text-end fw-bold text-success">
                        ¥{{ bet.amount }}
                    </td>
                    <td class="align-middle">
                        <small class="text-muted">
                            {{ bet.created_at|date:"Y-m-d H:i" }}
                        </small>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>

    <!-- 分页器 -->
    <div class="mt-4 d-flex justify-content-center">
        <!-- 这里可以添加分页控件 -->
    </div>
</div>
{% endblock %}